/**
 * Created by jacky on 2017/4/25.
 * banker developer jacky</br>
 */
import React, {PureComponent} from "react";
import ScrollableTabView from "react-native-scrollable-tab-view";
import SimpleView from "../SimpleView";
import TabBar from '../components/TabBar'

const tabTitles = ['食物百科', '逛吃', '我的']
const tabIcons = [
    require('../resource/ic_tab_search.png'),
    require('../resource/ic_tab_homepage.png'),
    require('../resource/ic_tab_my.png')
];
const tabSelectedIcon = [
    require('../resource/ic_tab_search_select.png'),
    require('../resource/ic_tab_homepage_select.png'),
    require('../resource/ic_tab_my_select.png')
];

export default class TabBarView extends PureComponent {

    _onChangeTab = ({i}) => 'light-content';

    render() {
        return (
            <ScrollableTabView
                renderTabBar={() =>
                    <TabBar
                        tabNames={tabTitles}
                        tabIconNames={tabIcons}
                        selectedTabIconNames={tabSelectedIcon}/>
                }
                tabBarPosition='bottom'
                locked
                scrollWithoutAnimation
                onChangeTab={this._onChangeTab}>

                {/*<FoodEncyclopedia tabLabel="Food" navigator={this.props.navigator}/>*/}
                {/*<Feed tabLabel="Home" navigator={this.props.navigator}/>*/}
                {/*<Profile tabLabel="Profile" navigator={this.props.navigator}/>*/}

                {/*{tabTitles.map((tabTitle, i) => {*/}
                {/*return (*/}
                {/*<SimpleView key={i} name={tabTitle}/>*/}
                {/*)*/}
                {/*})}*/}

                <SimpleView name={tabTitles[0]}/>
                <SimpleView name={tabTitles[1]}/>
                <SimpleView name={tabTitles[2]}/>

            </ScrollableTabView>
        )
    }
}